package com.jarvis.plugin.wxmock.config;

import com.jarvis.plugin.wxmock.interceptor.HttpclientInterceptor;
import com.jarvis.plugin.wxmock.interceptor.OkhttpInterceptor;
import com.jarvis.springboot.starter.guice.SpringModule;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author xuxukang
 * @create 2020/5/11 3:39 下午
 */
@Component
public class WxmockModule extends SpringModule {

  @Autowired
  public WxmockModule(ListableBeanFactory listableBeanFactory) {
    super(listableBeanFactory);
  }

  @Override
  protected void configure() {
    super.configure();

    bind(WxmockProperty.class)
        .toInstance(listableBeanFactory.getBean(WxmockProperty.class));

    requestStaticInjection(HttpclientInterceptor.class);
    requestStaticInjection(OkhttpInterceptor.class);
  }

}
